#include "ZBuffer.h"
#include <memory>


ZBuffer::ZBuffer(int w,int h,float farZ)
{
	int size = w * h * sizeof(float);
	data = (float*)malloc(size);
	_w = w;_h = h;
	_wXh = _w * _h;
	_farZ = farZ;
	clearBuffer();
}


ZBuffer::~ZBuffer(void)
{
}

void ZBuffer::clearBuffer()
{
	if (data)
	{
		for (int i = 0; i < _w * _h; i++)
		{
			data[i] = _farZ;
		}
	}
}
